/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.lottery.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.lottery.entity.Activity;
import com.thinkgem.jeesite.modules.lottery.dao.ActivityDao;

/**
 * 抽奖活动管理Service
 * @author Muser
 * @version 2019-07-31
 */
@Service
@Transactional(readOnly = true)
public class ActivityService extends CrudService<ActivityDao, Activity> {

	@Autowired
	private ActivityDao activityDao;

	public Activity get(String id) {
		return super.get(id);
	}
	
	public List<Activity> findList(Activity activity) {
		return super.findList(activity);
	}
	
	public Page<Activity> findPage(Page<Activity> page, Activity activity) {
		return super.findPage(page, activity);
	}

	public int getUserNumOfActivity(String openid){
		return activityDao.getUserNumOfActivity(openid);
	}

	public List<Activity> getWechatUserActivity(String openid){
		return activityDao.getWechatUserActivity(openid);
	}

	public List<Activity> getWechatUserOpenActivity(String openid){
		return activityDao.getWechatUserOpenActivity(openid);
	}

	public List<Activity> getWechatUserPrizeActivity(String openid){
		return activityDao.getWechatUserPrizeActivity(openid);
	}

	@Transactional(readOnly = false)
	public void save(Activity activity) {
		super.save(activity);
	}
	
	@Transactional(readOnly = false)
	public void delete(Activity activity) {
		super.delete(activity);
	}
	
}